﻿using Microsoft.EntityFrameworkCore;
using Vaccine.API.Infrastructure.EntityConfigurations;
using Vaccine.API.Repositories;

namespace Vaccine.API.Infrastructure
{
    public class VaccineDbContext : DbContext
    {
        public DbSet<VaccineInfo> VaccineInfos => Set<VaccineInfo>();

        public VaccineDbContext(DbContextOptions<VaccineDbContext> options)
        : base(options)
        {
            // No need for change tracking.
            ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking;
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.ApplyConfiguration(new VaccineInfoEntityTypeConfiguration());
        }
    }
}
